import Api from './api.js'
import request from '@/utils/request'
// 身份验证
export const Login = {
    LoginLoginAsync(_data) {
        return request.post(Api.LoginLoginAsync, _data)
    },
    // 金风验证
    JinFangLoginAsync(_data) {
        return request.post(Api.JinFangLoginAsync, _data)
    }
}
// Stage阶段(列)管理
export const Stage = {
    StageGetListAsync() {
        return request.get(Api.StageGetListAsync)
    },
    StageInsertAsync(_data) {
        return request.post(Api.StageInsertAsync, _data)
    },
    StageUpdateAsync(_data) {
        return request.post(Api.StageUpdateAsync, _data)
    },
    StageDeleteAsync(_data) {
        return request.get(Api.StageDeleteAsync, {
            params: _data
        })
    },
    StageSaveAsync(_data) {
        return request.post(Api.StageSaveAsync, _data)
    }
}
// Stage阶段(列)管理
export const ApiRequest = {
    ApiRequestInsertAsync() {
        return request.get(Api.ApiRequestInsertAsync)
    }
}

// LineCntroller泳道管理
export const LineCntroller = {
    LineCntrollerGetAllAsync() {
        return request.get(Api.LineCntrollerGetAllAsync)
    },
    LineCntrollerInsertAsync(_data) {
        return request.post(Api.LineCntrollerInsertAsync, _data)
    },
    LineCntrollerUpdateAsync(_data) {
        return request.post(Api.LineCntrollerUpdateAsync, _data)
    },
    LineCntrollerDeleteAsync(_data) {
        return request.get(Api.LineCntrollerDeleteAsync, {
            params: _data
        })
    }
}
// MarketProject营销项目状态管理
export const FormOptionSet = {
    FormOptionSetGetAllAsync() {
        return request.get(Api.FormOptionSetGetAllAsync)
    },
    FormOptionSetInsertAsync(_data) {
        return request.post(Api.FormOptionSetInsertAsync, _data)
    },
    FormOptionSetDeleteAsync(_data) {
        return request.get(Api.FormOptionSetDeleteAsync, {
            params: _data
        })
    },
    FormOptionSetUpdateAsync(_data) {
        return request.post(Api.FormOptionSetUpdateAsync, _data)
    },
    FormOptionSetSaveAsync(_data) {
        return request.post(Api.FormOptionSetSaveAsync, _data)
    },
    FormOptionSetMarketingProjectExport() {
        window.location.href = process.env.VUE_APP_BASE_API + Api.FormOptionSetMarketingProjectExport
    },
    FormOptionSetMarketingProjectParse(_data) {
        return request.post(Api.FormOptionSetMarketingProjectParse, _data)
    },
    FormOptionSetMarketingProjectImport(_data) {
        return request.post(Api.FormOptionSetMarketingProjectImport, _data)
    }
}

// MessageSet消息设置管理
export const MessageSet = {
    MessageSetGetAllMessageAsync() {
        return request.get(Api.MessageSetGetAllMessageAsync)
    },
    MessageSetInsertAsync(_data) {
        return request.post(Api.MessageSetInsertAsync, _data)
    },
    MessageSetUpdateAsync(_data) {
        return request.post(Api.MessageSetUpdateAsync, _data)
    },
    MessageSetDeleteAsync(_data) {
        return request.get(Api.MessageSetDeleteAsync, {
            params: _data
        })
    }
}

// User用户管理
export const User = {
    UserGetAllUserAsync() {
        return request.get(Api.UserGetAllUserAsync)
    },
    UserInsertAsync(_data) {
        return request.post(Api.UserInsertAsync, _data)
    },
    UserGetPageAsync(_data) {
        return request.post(Api.UserGetPageAsync, _data)
    }
}
// Product产品管理
export const Product = {
    ProductSetGetAllListAsync(data) {
        return request.post(Api.ProductSetGetAllListAsync, data)
    },
    ProInsertAsync() {
        return request.get(Api.ProInsertAsync)
    },
    ProductSetInsertAsync(_data) {
        return request.post(Api.ProductSetInsertAsync, _data)
    },
    ProductSetDeleteAsync(_data) {
        return request.get(Api.ProductSetDeleteAsync, {
            params: _data
        })
    },
    ProductSetUpdateAsync(_data) {
        return request.post(Api.ProductSetUpdateAsync, _data)
    },
    ProductSetInsertBatchAsync(_data) {
        return request.post(Api.ProductSetInsertBatchAsync, _data)
    }
}
// 邮件
export const EmailSetGet = {
    EmailSetGetLoadAsync(_data) {
        return request.get(Api.EmailSetGetLoadAsync, {
            params: _data
        })
    },
    EmailSetSaveAsync(_data) {
        return request.post(Api.EmailSetSaveAsync, _data)
    }
}

// 超期设置开发文档
export const IOverdueSetContract = {
    IOverdueSetContractGetAllAsync() {
        return request.get(Api.IOverdueSetContractGetAllAsync)
    },
    IOverdueSetContractUpdateAsync(_data) {
        return request.post(Api.IOverdueSetContractUpdateAsync, _data)
    },
    IOverdueSetContractInsertAsync(_data) {
        return request.post(Api.IOverdueSetContractInsertAsync, _data)
    }
}

// 公告管理
export const notice = {
    SendAndSaveAnnouncementAsync(_data) {
        return request.post(Api.SendAndSaveAnnouncementAsync, _data)
    }
}
